<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class RefundDetail extends Model
{
    use HasFactory;

    public static $statusMap = [
        0=>'退款中',
        1=>'退款成功',
        2=>'退款失败',
    ];

    public static $refundPlatformMap = [
        'shouqianba'=>'收钱吧',
        'es_balance'=>'会员余额',
        'cash'=>'现金',
        'mail_pos'=>'商场pos',
        'ali_pay'=>'支付宝',
        'bank_card'=>'银行卡',
        'wx_pay'=>'微信'
        //'guazhang'=>'挂账',
    ];

    public static function modifierStatus($key)
    {
        return [
            'title'=>self::$statusMap[$key]??'',
            'code'=>$key,
        ];
    }

    public static function modifierRefundPlatform($key)
    {
        return [
            'title'=>self::$refundPlatformMap[$key]??'',
            'code'=>$key,
        ];
    }
}
